package com.java0430;


public class Student extends Person{

    private String subject;


    public void study(){
        //调用父类的getName()方法
        System.out.println((super.getName() + "在学习" + subject);

    }
    public  Student(String name,int age,String gender,String subject){
        super(name,age,gender);
        this.subject=subject;
    }
    public Student (){}
    public String getSubject() {
        return subject;
    }
    public void setSubject(String subject) {
        this.subject = subject;
    }
}
